<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateNotify extends Migrator
{
    public function up()
    {

        $sql = <<<SQL
CREATE TABLE `notify` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `params` text COLLATE utf8mb4_general_ci NOT NULL COMMENT '请求参数',
  `created_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '回调时间',
  `from` varchar(30) COLLATE utf8mb4_general_ci DEFAULT '',
  `relation_no` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '关联id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


SQL;


        $this->execute($sql);

    }

    public function down()
    {
        $this->table('notify')
            ->drop();
    }
}
